﻿package Classes.Generators{
	
	import Classes.Target.*;

	public class TargetGenerator {
		
		private var prevSeed:Number = -1;

		/* @return: een random doelwit */
		public function getRandomTarget():Doelwit {

			/* Random number */
			var i:Number=Math.floor(Math.random()*5);
			var d:Doelwit;

			if (i==0) {

				var j:Number=Math.floor(Math.random()*4);
				
				switch(j){
				
					case 0: 
					d = new mcFalseTargetHippie();
					d.setScore(-10);
					break;
					
					case 1: 
					d = new mcFalseTargetMuzikant(); 
					d.setScore(-15);
					break;
					
					case 2: 
					d = new mcFalseTargetOber();
					d.setScore(-5);
					break;
					
					case 3: 
					d = new mcFalseTargetRugzak();
					d.setScore(-20);
					break;
				
				}

			} else {
				
				var k:Number=Math.floor(Math.random()*2);
				
				switch(k){
				
					case 0: 
					d = new mcTrueTargetKoe();
					d.setScore(10);
					break;
					
					case 1: 
					d = new mcTrueTargetKonijn();
					d.setScore(20);
					break;
				
				}

			}
			
			return d;

		}
		
		/* @return: een random doelwit */
		public function getBackgroundTarget():Doelwit {
			
			var i:Number=Math.floor(Math.random()*4)+1;
			var d:Doelwit;

			switch(i){
				
				case 0: 
				d = new mcNullTargetBord();
				break;
				
				case 1: 
				d = new mcNullTargetParasol(); 
				break;
				
				case 2: 
				d = new mcNullTargetTent(); 
				break;
				
				case 3: 
				d = new mcNullTargetToiToi(); 
				break;
				
				case 4: 
				d = new mcNullTargetBoom(); 
				break;
				
			}
			
			return d;

		}
		
		public function getForeGroundTarget():Doelwit {
			
			var i:Number=Math.floor(Math.random()*2);
			var d:Doelwit;

			switch(i){
				
				case 0: 
				d = new mcNullTargetStruik(); 
				break;
				
				case 1: 
				d = new mcNullTargetStruik2(); 
				break;
				
			}
			
			return d;

		}

	}

}